home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Multimedia / Resource Library: Multimedia.iso / sgml / msdos / sgml07 / std.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-03-27  |  1.9 KB  |  99 lines

  1. /* std.h -
  2.    Include standard header files.
  3. */
  4.  
  5. #ifndef STD_H
  6. #define STD_H 1
  7.  
  8. #include <stdio.h>
  9. #include <ctype.h>
  10. #include <errno.h>
  11. #include <assert.h>
  12. #ifdef SUPPORT_SUBDOC
  13. #include <signal.h>
  14. #endif /* SUPPORT_SUBDOC */
  15.  
  16. #ifdef BSD_STRINGS
  17. #include <strings.h>
  18. #define memcpy(to, from, n) bcopy(from, to, n)
  19. #define memcmp(p, q, n) bcmp(p, q, n)
  20. #define strchr(s, c) index(s, c)
  21. #define strrchr(s, c) rindex(s, c)
  22. #else /* not BSD_STRINGS */
  23. #include <string.h>
  24. #endif /* not BSD_STRINGS */
  25.  
  26. #ifdef STRERROR_MISSING
  27. #ifdef USE_PROTOTYPES
  28. extern char *strerror(int);
  29. #else
  30. extern char *strerror();
  31. #endif
  32. #endif /* STRERROR_MISSING */
  33.  
  34. #ifdef STDLIB_H_MISSING
  35. UNIV malloc();
  36. UNIV calloc();
  37. UNIV realloc();
  38. char *getenv();
  39. long atol();
  40. #else /* not STDLIB_H_MISSING */
  41. #include <stdlib.h>
  42. #endif /* not STDLIB_H_MISSING */
  43.  
  44. #ifndef STDDEF_H_MISSING
  45. #include <stddef.h>
  46. #endif /* not STDDEF_H_MISSING */
  47.  
  48. #ifndef offsetof
  49. #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
  50. #endif
  51.  
  52. #ifdef VARARGS
  53. #include <varargs.h>
  54. #else
  55. #include <stdarg.h>
  56. #endif
  57.  
  58. #ifndef EXIT_FAILURE
  59. #define EXIT_FAILURE 1
  60. #endif
  61. #ifndef EXIT_SUCCESS
  62. #define EXIT_SUCCESS 0
  63. #endif
  64.  
  65. #ifndef SEEK_SET
  66. #define SEEK_SET 0
  67. #define SEEK_CUR 1
  68. #define SEEK_END 2
  69. #endif
  70.  
  71. /* Old BSD systems lack L_tmpnam and tmpnam().  This is a partial
  72. emulation using mktemp().  It requires that the argument to tmpnam()
  73. be non-NULL. */
  74.  
  75. #ifndef L_tmpnam
  76. #define tmpnam_template "/tmp/sgmlsXXXXXX"
  77. #define L_tmpnam (sizeof(tmpnam_template))
  78. #undef tmpnam
  79. #define tmpnam(buf) \
  80.   (mktemp(strcpy(buf, tmpnam_template)) == 0 || (buf)[0] == '\0' ? 0 : (buf))
  81. #endif /* not L_tmpnam */
  82.  
  83.  
  84. #ifdef REMOVE_MISSING
  85. #ifdef HAVE_UNISTD_H
  86. #include <unistd.h>
  87. #endif /* HAVE_UNISTD_H */
  88. #define remove unlink
  89. #endif /* REMOVE_MISSING */
  90.  
  91. #ifdef RAISE_MISSING
  92. #ifdef HAVE_UNISTD_H
  93. #include <unistd.h>
  94. #endif /* HAVE_UNISTD_H */
  95. #define raise(sig) kill(getpid(), sig)
  96. #endif /* RAISE_MISSING */
  97.  
  98. #endif /* not STD_H */
  99.